home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / MacHaskell 2.2 / progs / lib / X11 / xlib.hs < prev    next >
Encoding:
Text File  |  1994-09-27  |  30.2 KB  |  896 lines  |  [TEXT/YHS2]

  1. module Xlib(XLibTypes..,XLibPrims..) where
  2. import XLibTypes
  3. import XLibPrims
  4.  
  5. module XLibTypes(XMArray, TimeZone(..), 
  6.                  XDisplay, XScreen, XWindow, XGcontext, XPixmap,
  7.                  XColormap, XCursor, XFont, XImage, XMaybe(..), XError(..),
  8.                  XBitmap(..), XKeysymTable(..), XBitVec(..),
  9.                  XPixarray(..), XByteVec(..), XAtom(..), XProperty(..),
  10.                  XPixel(..), XDrawable(..), XTime(..), XSwitch(..),
  11.          XWindowPlace(..), XEventMode(..), XEventKind(..),
  12.          XWindowVisibility(..), XWindowStackMode(..),
  13.          XPropertyState(..), XMapReqType(..), XGraphFun(..),
  14.          XEvent(..), XEventType(..), XEventSlot(..), XEventMask(..),
  15.          XEventMaskKey(..), XStateMask(..), XStateMaskKey(..),
  16.          XWinAttribute(..),XGCAttribute(..), XImAttribute(..), 
  17.          XGrabAttribute(..), XArcMode(..), XCapStyle(..),
  18.          XClipMask(..), XFillRule(..), XFillStyle(..), 
  19.          XFunction(..), XJoinStyle(..), XLineStyle(..),
  20.          XSubwindowMode(..), XPoint(..), XSize(..), XRect(..),
  21.          XArc(..), XBitmapFormat(..), XByteOrder(..),
  22.          XPixmapFormat(..), XVisualInfo(..), XVisualClass(..),
  23.          XFillContent(..), XBackingStore(..), XGravity(..),
  24.          XWindowClass(..), XMapState(..), XImageData(..), 
  25.          XImageFormat(..), XImageType(..), XDrawDirection(..),
  26.          XColor(..), XInputFocus(..), XGrabStatus(..),
  27.          XKeysym(..), XCloseDownMode(..), XScreenSaver(..))
  28.     where
  29.  
  30. data XMArray a = XMArray a -- used as an abstract type
  31.  
  32. -- decoded time format:
  33. -- ([second, minute, hour, date, month, year, day-of-week], 
  34. --  daylight-saving-time-p)
  35. -- time format to encode:
  36. -- [second, minute, hour, date, month, year]
  37.  
  38. data TimeZone    = WestOfGMT Int {-# STRICT #-}
  39.         | CurrentZone
  40.  
  41. {-# ImportLispType (TimeZone (WestOfGMT ("number?", "identity", "identity"),
  42.                               CurrentZone ("null?", "'()")))
  43. #-}
  44.  
  45.  
  46. data XMaybe a {-# STRICT #-} = XSome a         
  47.                           | XNull
  48.           --deriving (Printers)
  49.  
  50. data XDisplay         = XDisplay      --deriving (Printers)
  51. data XScreen         = XScreen     --deriving (Printers)
  52. data XWindow         = XWindow     --deriving (Printers)
  53. data XGcontext         = XGcontext     --deriving (Printers)
  54. data XPixmap         = XPixmap     --deriving (Printers)
  55. data XColormap         = XColormap     --deriving (Printers)
  56. data XCursor         = XCursor     --deriving (Printers)
  57. data XFont         = XFont         --deriving (Printers)
  58. data XImage         = XImage     --deriving (Printers)
  59.  
  60. data XError {-# STRICT #-}
  61.               = XError String     
  62.                 --deriving Printers
  63. data XBitmap {-# STRICT #-}
  64.              = XBitmap [[Int]]
  65. instance Text(XBitmap) where
  66.   showsPrec p x = showString "<<XBitMap>>"
  67.    
  68. data XKeysymTable {-# STRICT #-}
  69.              = XKeysymTable [[Integer]]    
  70. instance Text(XKeysymTable) where
  71.   showsPrec p x = showString "<<XKeysymTable>>"
  72.  
  73. data XBitVec {-# STRICT #-}
  74.              = XBitVec [Int]            
  75. instance Text(XBitVec) where
  76.   showsPrec p x = showString "<<XBitVec>>"
  77.  
  78. data XPixarray {-# STRICT #-}
  79.             = XPixarray [[Integer]]        
  80. instance Text(XPixarray) where
  81.   showsPrec p x = showString "<<XPixarray>>"
  82.  
  83. data XByteVec {-# STRICT #-}
  84.              = XByteVec [Int]
  85. instance Text(XByteVec) where
  86.   showsPrec p x = showString "<<XByteVec>>"
  87.  
  88.  
  89. data XAtom {-# STRICT #-}
  90.              = XAtom String         
  91.     --deriving (Printers)
  92.  
  93. data XProperty {-#STRICT #-}
  94.              = XProperty [Integer]      -- data
  95.                      XAtom      -- type
  96.                          Int        -- format
  97.        --deriving (Printers)
  98.  
  99. data XPixel {-# STRICT #-}
  100.             = XPixel Integer
  101.        --deriving (Printers)
  102.  
  103. data XDrawable {-# STRICT #-}
  104.             = XDrawWindow XWindow 
  105.             | XDrawPixmap XPixmap
  106.     --deriving (Printers)
  107.  
  108. data XTime {-# STRICT #-}
  109.             = XTime Integer 
  110.     --deriving (Printers)
  111.  
  112. data XSwitch    = XOn
  113.                 | XOff
  114.         --deriving (Printers)
  115.  
  116. data XWindowPlace     = XTopPlace
  117.             | XBottomPlace
  118.     --deriving (Printers)
  119.  
  120. data XEventMode        = XNormalMode
  121.             | XGrabMode
  122.             | XUngrabMode
  123.             | XWhileGrabbedMode
  124.     --deriving (Printers)
  125.  
  126. data XEventKind        = XAncestorKind
  127.             | XVirtualKind
  128.             | XInferiorKind
  129.             | XNonlinearKind
  130.             | XNonlinearVirtualKind
  131.             | XPointerKind
  132.             | XPointerRootKind
  133.             | XNoneKind
  134.     --deriving (Printers)
  135.  
  136. data XWindowVisibility    = XUnobscured
  137.             | XPartiallyObscured
  138.             | XFullyObscured
  139.     --deriving (Printers)
  140.  
  141. data XWindowStackMode    = XStackAbove
  142.             | XStackBelow
  143.             | XStackTopIf
  144.             | XStackBottomIf
  145.             | XStackOpposite
  146.     --deriving (Printers)
  147.  
  148. data XPropertyState    = XNewValueProperty
  149.             | XDeletedProperty
  150.     --deriving (Printers)
  151.  
  152. data XMapReqType    = XModifierMapping
  153.             | XKeyboardMapping
  154.             | XPointerMapping
  155.     --deriving (Printers)
  156.  
  157. data XGraphFun {-# STRICT #-}
  158.             = XGraphFun Int  -- major opcode
  159.                      Int  -- minor opcode
  160.     --deriving (Printers)
  161.  
  162. data XEvent {-# STRICT #-}
  163.             = XEvent XEventType
  164.                  [XEventSlot]
  165.  
  166. data XEventType =       XKeyPressEvent
  167.                 | XKeyReleaseEvent
  168.                 | XButtonPressEvent
  169.                 | XButtonReleaseEvent
  170.                 | XMotionNotifyEvent
  171.                 | XEnterNotifyEvent
  172.                 | XLeaveNotifyEvent
  173.                 | XFocusInEvent
  174.             | XFocusOutEvent
  175.                     | XKeymapNotifyEvent
  176.                     | XMappingNotifyEvent
  177.                     | XExposureEvent
  178.                     | XGraphicsExposureEvent
  179.                     | XNoExposureEvent
  180.                     | XCirculateNotifyEvent 
  181.                     | XConfigureNotifyEvent
  182.                     | XCreateNotifyEvent
  183.                     | XDestroyNotifyEvent
  184.                     | XGravityNotifyEvent
  185.                     | XMapNotifyEvent
  186.                     | XReparentNotifyEvent
  187.                     | XUnmapNotifyEvent
  188.                     | XVisibilityNotifyEvent
  189.                     | XCirculateRequestEvent
  190.                     | XColormapNotifyEvent
  191.                     | XConfigureRequestEvent
  192.                     | XMapRequestEvent
  193.                     | XResizeRequestEvent
  194.                     | XClientMessageEvent
  195.                     | XPropertyNotifyEvent
  196.                     | XSelectionClearEvent
  197.                     | XSelectionNotifyEvent
  198.                     | XSelectionRequestEvent
  199.                     | XOtherEvents
  200.        --deriving Printers
  201.  
  202. data XEventSlot {-# STRICT #-}
  203.                 = XEventWindow XWindow        
  204.         | XEventEventWindow XWindow    
  205.         | XEventCode Int        
  206.         | XEventPos XPoint        
  207.         | XEventState XStateMask    
  208.         | XEventTime XTime         
  209.         | XEventRoot XWindow         
  210.         | XEventRootPos XPoint        
  211.         | XEventChild (XMaybe XWindow)    
  212.         | XEventSameScreenP Bool    
  213.         | XEventHintP Bool        
  214.         | XEventMode XEventMode        
  215.         | XEventKind XEventKind        
  216.         | XEventFocusP Bool        
  217.         | XEventKeymap XBitVec        
  218.         | XEventRequest XMapReqType    
  219.         | XEventStart Int        
  220.         | XEventCount Int        
  221.         | XEventRect XRect        
  222.         | XEventDrawable XDrawable    
  223.         | XEventXGraphFun XGraphFun    
  224.         | XEventPlace XWindowPlace    
  225.         | XEventBorderWidth Int        
  226.         | XEventAboveSibling (XMaybe XWindow)
  227.         | XEventOverrideRedirectP Bool    
  228.         | XEventParent XWindow        
  229.         | XEventConfigureP Bool        
  230.         | XEventVisibility XWindowVisibility
  231.         | XEventNewP Bool        
  232.         | XEventInstalledP Bool        
  233.         | XEventStackMode XWindowStackMode
  234.         | XEventValueMask Int        
  235.         | XEventSize XSize        
  236.         | XEventMessage XProperty    
  237.         | XEventPropertyState XPropertyState
  238.         | XEventAtom XAtom        
  239.         | XEventSelection XAtom        
  240.         | XEventTarget XAtom        
  241.         | XEventProperty (XMaybe XAtom)    
  242.         | XEventRequestor XWindow
  243.        --deriving Printers
  244.  
  245. data XEventMask {-# STRICT #-}
  246.              = XEventMask [XEventMaskKey] 
  247.        --deriving (Printers)
  248.  
  249. data XEventMaskKey 
  250.         = XButton1Motion
  251.         | XButton2Motion
  252.         | XButton3Motion
  253.         | XButton4Motion
  254.         | XButton5Motion
  255.         | XButtonMotion
  256.                 | XButtonPress
  257.         | XButtonRelease
  258.         | XColormapChange
  259.         | XEnterWindow
  260.         | XExposure
  261.         | XFocusChange
  262.         | XKeyPress
  263.         | XKeyRelease
  264.         | XKeymapState
  265.         | XLeaveWindow
  266.         | XOwnerGrabButton
  267.         | XPointerMotion
  268.         | XPointerMotionHint
  269.         | XPropertyChange
  270.         | XResizeRedirect
  271.         | XStructureNotify
  272.         | XSubstructureRedirect
  273.         | XVisibilityChange
  274.       --deriving (Printers)
  275.  
  276. data XStateMask    {-# STRICT #-}
  277.             = XStateMask [XStateMaskKey] 
  278.         --deriving (Printers)
  279.  
  280. data XStateMaskKey
  281.         = XShift
  282.         | XLock
  283.         | XControl
  284.         | XMod1
  285.         | XMod2
  286.         | XMod3
  287.         | XMod4
  288.         | XMod5
  289.         | XButton1
  290.         | XButton2
  291.         | XButton3
  292.         | XButton4
  293.         | XButton5
  294.     --deriving (Printers)
  295.  
  296. data XWinAttribute {-# STRICT #-} 
  297.         = XWinBackground XPixel 
  298.                 | XWinEventMask XEventMask 
  299.                 | XWinDepth Int     
  300.         | XWinBorderWidth Int     
  301.         | XWinClass XWindowClass 
  302.         | XWinVisual Int     
  303.         | XWinBorder XFillContent 
  304.         | XWinBackingStore XBackingStore
  305.         | XWinBackingPlanes XPixel 
  306.         | XWinBackingPixel XPixel 
  307.         | XWinSaveUnder XSwitch    
  308.         | XWinDoNotPropagateMask XEventMask
  309.         | XWinOverrideRedirect XSwitch 
  310.         | XWinColormap XColormap 
  311.         | XWinCursor XCursor     
  312.      --deriving (Printers)
  313.  
  314. data XGCAttribute {-# STRICT #-}
  315.         = XGCArcMode XArcMode     
  316.         | XGCBackground XPixel     
  317.         | XGCCapStyle XCapStyle 
  318.         | XGCClipMask XClipMask 
  319.         | XGCClipOrigin XPoint     
  320.         | XGCDashOffset Int     
  321.         | XGCDashes [Int]     
  322.         | XGCExposures XSwitch     
  323.         | XGCFillRule XFillRule 
  324.         | XGCFillStyle XFillStyle 
  325.         | XGCFont XFont     
  326.         | XGCForeground XPixel     
  327.         | XGCFunction XFunction 
  328.         | XGCJoinStyle XJoinStyle 
  329.         | XGCLineStyle XLineStyle 
  330.         | XGCLineWidth Int     
  331.         | XGCPlaneMask XPixel     
  332.         | XGCStipple XPixmap     
  333.         | XGCSubwindowMode XSubwindowMode
  334.         | XGCTile XPixmap     
  335.         | XGCTileOrigin XPoint     
  336.         --deriving (Printers)
  337.  
  338. data XImAttribute {-# STRICT #-}
  339.         = XImBitLsbFirstP Bool     
  340.         | XImBitsPerPixel Int     
  341.         | XImBlueMask XPixel     
  342.         | XImByteLsbFirstP Bool 
  343.         | XImBytesPerLine Int     
  344.         | XImData XImageData     
  345.         | XImDepth Int         
  346.         | XImFormat XImageFormat 
  347.         | XImGreenMask XPixel     
  348.         | XImSize XSize     
  349.         | XImName String     
  350.         | XImRedMask XPixel     
  351.         | XImHotSpot XPoint     
  352.        --deriving (Printers)
  353.  
  354. data XGrabAttribute {-# STRICT #-}
  355.         = XGrabOwnerP Bool     
  356.         | XGrabSyncPointerP Bool 
  357.         | XGrabSyncKeyboardP Bool 
  358.         | XGrabConfineTo XWindow 
  359.         | XGrabCursor XCursor     
  360.        --deriving (Printers)
  361.  
  362. data XArcMode    = XChord
  363.         | XPieSlice
  364.           --deriving (Printers)
  365.  
  366. data XCapStyle    = XButt
  367.         | XNotLast
  368.         | XProjecting
  369.         | XRound
  370.        --deriving (Printers)
  371.  
  372. data XClipMask {-# STRICT #-}
  373.             = XClipMaskPixmap XPixmap 
  374.         | XClipMaskRects [XRect]
  375.         | XClipMaskNone
  376.        --deriving (Printers)
  377.  
  378. data XFillRule  = XFillEvenOdd
  379.         | XFillWinding
  380.        --deriving (Printers)
  381.  
  382. data XFillStyle = XFillOpaqueStippled
  383.         | XFillSolid
  384.         | XFillStippled
  385.         | XFillTiled
  386.        --deriving (Printers)
  387.  
  388. data XFunction    = XBoole1
  389.         | XBoole2
  390.         | XBooleAndC1
  391.         | XBooleAndC2
  392.         | XBooleAnd
  393.         | XBooleC1
  394.         | XBooleC2
  395.         | XBooleClr
  396.         | XBooleEqv
  397.         | XBooleIor
  398.         | XBooleNand
  399.         | XBooleNor
  400.         | XBooleOrc1
  401.         | XBooleOrc2
  402.         | XBooleSet
  403.         | XBooleXor
  404.        --deriving (Printers)
  405.  
  406. data XJoinStyle    = XJoinBevel
  407.         | XJoinMiter
  408.         | XJoinRound
  409.        --deriving (Printers)
  410.  
  411. data XLineStyle = XLineSolid
  412.         | XLineDoubleDash
  413.         | XLineOnOffDash
  414.        --deriving (Printers)
  415.  
  416. data XSubwindowMode    = XClipByChildren
  417.             | XIncludeInferiors
  418.        --deriving (Printers)
  419.  
  420. -- BASIC GEOMETRY
  421.  
  422. data XPoint {-# STRICT #-} = XPoint Int Int        -- x,y
  423.        --deriving (Printers)
  424.  
  425. data XSize {-# STRICT #-} = XSize Int Int               -- width, height
  426.        --deriving (Printers)
  427.  
  428. data XRect {-# STRICT #-} = XRect Int Int Int Int       -- x, y, width, height
  429.        --deriving (Printers)
  430.  
  431. data XArc {-# STRICT #-} = XArc Int Int Int Int Float Float
  432.        --deriving (Printers)  -- x, y, width, height, angle1, angle2
  433.  
  434. data XBitmapFormat {-# STRICT #-} = XBitmapFormat Int Int Bool
  435.           --deriving (Printers) -- unit, pad, lsb-first-p
  436.  
  437. data XByteOrder = XLsbFirst
  438.                 | XMsbFirst
  439.            --deriving (Printers)
  440.  
  441. data XPixmapFormat {-# STRICT #-} = XPixmapFormat Int Int Int
  442.          --deriving (Printers) -- depth, bits-per-pixel, scanline-pad
  443.  
  444. data XVisualInfo {-# STRICT #-} = XVisualInfo 
  445.             Int         -- id 
  446.                         XVisualClass     -- class 
  447.                         XPixel         -- red-mask 
  448.                         XPixel         -- green-mask 
  449.                         XPixel         -- blue-mask 
  450.                         Int         -- bits-per-rgb
  451.             Int         -- colormap-entries
  452.         --deriving (Printers)
  453.  
  454. data XVisualClass    = XDirectColor
  455.             | XGrayScale
  456.             | XPseudoColor
  457.             | XStaticColor
  458.             | XStaticGray
  459.             | XTrueColor
  460.         --deriving (Printers)
  461.  
  462. data XFillContent {-# STRICT #-} 
  463.                     = XFillPixel XPixel
  464.             | XFillPixmap XPixmap 
  465.             | XFillNone
  466.             | XFillParentRelative
  467.             | XFillCopy
  468.         --deriving (Printers)
  469.  
  470. data XBackingStore     = XAlwaysBackStore
  471.             | XNeverBackStore
  472.             | XBackStoreWhenMapped
  473.             | XBackStoreNotUseful
  474.         --deriving (Printers)
  475.  
  476. data XGravity    = XForget
  477.         | XStatic
  478.         | XCenter
  479.         | XEast
  480.         | XNorth
  481.         | XNorthEast
  482.         | XNorthWest
  483.         | XSouth
  484.         | XSouthEast
  485.         | XSouthWest
  486.         | XWest
  487.         --deriving (Printers)
  488.  
  489. data XWindowClass     = XInputOutput
  490.             | XInputOnly
  491.         --deriving (Printers)
  492.  
  493. data XMapState        = XUnmapped
  494.             | XUnviewable
  495.             | XViewable
  496.         --deriving (Printers)
  497.  
  498. data XImageData    {-# STRICT #-} 
  499.                 = XBitmapData [XBitmap]
  500.         | XPixarrayData XPixarray
  501.         | XByteVecData XByteVec
  502.         --deriving (Printers)
  503.  
  504. data XImageFormat     = XXyPixmapImage
  505.             | XZPixmapImage
  506.             | XBitmapImage
  507.         --deriving (Printers)
  508.  
  509. data XImageType    = XImageX
  510.         | XImageXy
  511.         | XImageZ
  512.         --deriving (Printers)
  513.  
  514. data XDrawDirection    = XLeftToRight
  515.             | XRightToLeft
  516.         --deriving (Printers)
  517.  
  518. data XColor {-# STRICT #-} = XColor Float Float Float
  519.         --deriving (Printers)
  520.  
  521. data XInputFocus {-# STRICT #-}
  522.                     = XFocusWindow XWindow
  523.             | XFocusNone
  524.             | XFocusPointerRoot
  525.             | XFocusParent
  526.         --deriving (Printers)
  527.  
  528. data XGrabStatus    = XAlreadyGrabbed
  529.             | XFrozen
  530.             | XInvalidTime
  531.             | XNotViewable
  532.             | XSuccess
  533.         --deriving (Printers)
  534.  
  535.  
  536. data XKeysym {-# STRICT #-} = XKeysym Integer
  537.         --deriving (Printers)
  538.  
  539.  
  540. data XCloseDownMode    = XDestroy
  541.             | XRetainPermanent
  542.             | XRetainTemporary
  543.         --deriving (Printers)
  544.  
  545. data XScreenSaver {-# STRICT #-} = XScreenSaver Int Int Bool Bool
  546.        --deriving (Printers)
  547.  
  548. {-#
  549. ImportLispType (
  550.    XMaybe (XSome ("not-null?", "identity", "identity"),
  551.            XNull ("null?", "'()")),
  552.    XError (XError ("cons-xerror", "x-error-string")),
  553.    XBitmap (XBitmap ("mk-bitmap", "sel-bitmap")),
  554.    XKeysymTable (XKeysymTable ("mk-keysym-table", "sel-keysym-table")),
  555.    XBitVec (XBitVec ("mk-bitvec", "sel-bitvec")),
  556.    XPixarray (XPixarray ("mk-pixarray", "sel-pixarray")),
  557.    XByteVec (XByteVec ("mk-bytevec", "sel-bytevec")),
  558.    XAtom (XAtom ("mk-atom", "sel-atom")),
  559.    XProperty (XProperty ("mk-xproperty", "sel-xproperty-data", 
  560.                      "sel-xproperty-type", "sel-xproperty-format")),
  561.    XDrawable (XDrawWindow ("xlib:window-p", "identity", "identity"),
  562.            XDrawPixmap ("xlib:pixmap-p", "identity", "identity")),
  563.    XSwitch ( XOn(":on"), XOff(":off")),
  564.    XWindowPlace (XTopPlace (":top"), XBottomPlace (":bottom")),
  565.    XEventMode (XNormalMode (":normal"),
  566.                XGrabMode (":grab"),
  567.            XUngrabMode (":ungrab"),
  568.            XWhileGrabbedMode (":while-grabbed")),
  569.    XEventKind (XAncestorKind (":ancestor"),
  570.                XVirtualKind (":virtual"),
  571.                XInferiorKind (":inferior"),
  572.                XNonlinearKind (":nonlinear"),
  573.                XNonlinearVirtualKind (":nonlinear-virtual"),
  574.                XPointerKind (":pointer"),
  575.                XPointerRootKind (":pointer-root"),
  576.                XNoneKind (":none")),
  577.    XWindowVisibility (XUnobscured (":unobscured"),
  578.                       XPartiallyObscured (":partially-obscured"),
  579.                       XFullyObscured (":fully-obscured")),
  580.    XWindowStackMode (XStackAbove (":above"),
  581.                      XStackBelow (":below"),
  582.              XStackTopIf (":top-if"),
  583.              XStackBottomIf (":bottom-if"),
  584.              XStackOpposite (":opposite")),
  585.    XPropertyState (XNewValueProperty (":new-value"),
  586.                    XDeletedProperty (":deleted")),
  587.    XMapReqType (XModifierMapping (":modifier"),
  588.                 XKeyboardMapping (":keyboard"),
  589.         XPointerMapping (":pointer")),
  590.    XGraphFun (XGraphFun ("cons", "car", "cdr")),
  591.    XEvent (XEvent ("mk-event", "sel-event-type", "sel-event-slots")),
  592.    XEventType (XKeyPressEvent (":key-press"),
  593.                XKeyReleaseEvent (":key-release"),
  594.            XButtonPressEvent (":button-press"),
  595.            XButtonReleaseEvent (":button-release"),
  596.            XMotionNotifyEvent (":motion-notify"),
  597.            XEnterNotifyEvent (":enter-notify"),
  598.            XLeaveNotifyEvent (":leave-notify"),
  599.            XFocusInEvent (":focus-in"),
  600.            XFocusOutEvent (":focus-out"),
  601.            XKeymapNotifyEvent (":keymap-notify"),
  602.            XMappingNotifyEvent (":mapping-notify"),
  603.            XExposureEvent (":exposure"),
  604.            XGraphicsExposureEvent (":graphics-exposure"),
  605.            XNoExposureEvent (":no-exposure"),
  606.            XCirculateNotifyEvent (":circulate-notify"),
  607.            XConfigureNotifyEvent (":configure-notify"),
  608.            XCreateNotifyEvent (":create-notify"),
  609.            XDestroyNotifyEvent (":destroy-notify"),
  610.            XGravityNotifyEvent (":gravity-notify"),
  611.            XMapNotifyEvent (":map-notify"),
  612.            XReparentNotifyEvent (":reparent-notify"),
  613.            XUnmapNotifyEvent (":unmap-notify"),
  614.            XVisibilityNotifyEvent (":visibility-notify"),
  615.            XCirculateRequestEvent (":circulate-notify"),
  616.            XColormapNotifyEvent (":colormap-notify"),
  617.            XConfigureRequestEvent (":configure-request"),
  618.            XMapRequestEvent (":map-request"),
  619.            XResizeRequestEvent (":resize-request"),
  620.            XClientMessageEvent (":client-message"),
  621.            XPropertyNotifyEvent (":property-notify"),
  622.            XSelectionClearEvent (":selection-clear"),
  623.            XSelectionNotifyEvent (":selection-notify"),
  624.            XSelectionRequestEvent (":selection-request"),
  625.            XOtherEvents (":others")),
  626.    XEventSlot (XEventWindow ("is-window", "mk-window", "keyword-val"),
  627.                XEventEventWindow
  628.                   ("is-event-window", "mk-event-window", "keyword-val"),
  629.            XEventCode ("is-code", "mk-code", "keyword-val"),
  630.            XEventPos ("is-pos", "mk-pos", "keyword-val"),
  631.            XEventState ("is-state", "mk-state", "keyword-val"),
  632.            XEventTime ("is-time", "mk-time", "keyword-val"),
  633.            XEventRoot ("is-root", "mk-root", "keyword-val"),
  634.            XEventRootPos ("is-root-pos", "mk-root-pos", "keyword-val"),
  635.            XEventChild ("is-child", "mk-child", "keyword-val"),
  636.            XEventSameScreenP
  637.                   ("is-same-screen-p", "mk-same-screen-p", "keyword-val"),
  638.            XEventHintP ("is-hint-p", "mk-hint-p", "keyword-val"),
  639.            XEventMode ("is-mode", "mk-mode", "keyword-val"),
  640.            XEventKind ("is-kind", "mk-kind", "keyword-val"),
  641.            XEventFocusP ("is-focus-p", "mk-focus-p", "keyword-val"),
  642.            XEventKeymap ("is-keymap", "mk-keymap", "keyword-val"),
  643.            XEventRequest ("is-request", "mk-request", "keyword-val"),
  644.            XEventStart ("is-start", "mk-start", "keyword-val"),
  645.            XEventCount ("is-count", "mk-count", "keyword-val"),
  646.            XEventRect ("is-rect", "mk-rect", "keyword-val"),
  647.            XEventDrawable ("is-drawable", "mk-drawable", "keyword-val"),
  648.            XEventXGraphFun ("is-graph-fun", "mk-graph-fun", "keyword-val"),
  649.            XEventPlace ("is-place", "mk-place", "keyword-val"),
  650.            XEventBorderWidth
  651.                 ("is-border-width", "mk-border-width", "keyword-val"),
  652.            XEventAboveSibling 
  653.                 ("is-above-sibling", "mk-above-sibling", "keyword-val"),
  654.            XEventOverrideRedirectP
  655.                 ("is-override-redirect-p", "mk-override-redirect-p", "keyword-val"),
  656.            XEventParent ("is-parent", "mk-parent", "keyword-val"),
  657.            XEventConfigureP ("is-configure-p", "mk-configure-p", "keyword-val"),
  658.            XEventVisibility ("is-visibility", "mk-visibility", "keyword-val"),
  659.            XEventNewP ("is-new-p", "mk-new-p", "keyword-val"),
  660.            XEventInstalledP ("is-installed-p", "mk-installed-p", "keyword-val"),
  661.            XEventStackMode ("is-stack-mode", "mk-stack-mode", "keyword-val"),
  662.            XEventValueMask ("is-value-mask", "mk-value-mask", "keyword-val"),
  663.            XEventSize ("is-size", "mk-size", "keyword-val"),
  664.            XEventMessage ("is-message", "mk-message", "keyword-val"),
  665.            XEventPropertyState
  666.                  ("is-property-state", "mk-property-state", "keyword-val"),
  667.            XEventAtom ("is-atom", "mk-atom", "keyword-val"),
  668.            XEventSelection ("is-selection", "mk-selection", "keyword-val"),
  669.            XEventTarget ("is-target", "mk-target", "keyword-val"),
  670.            XEventProperty ("is-property", "mk-property", "keyword-val"),
  671.            XEventRequestor ("is-requestor", "mk-requestor", "keyword-val")),
  672.    XEventMask (XEventMask ("x-make-event-mask", "x-event-mask-key-list")),
  673.    XEventMaskKey (XButton1Motion (":button-1-motion"),
  674.                   XButton2Motion (":button-2-motion"),
  675.           XButton3Motion (":button-3-motion"),
  676.           XButton4Motion (":button-4-motion"),
  677.           XButton5Motion (":button-5-motion"),
  678.           XButtonMotion (":button-motion"),
  679.           XButtonPress (":button-press"),
  680.           XButtonRelease (":button-release"),
  681.           XColormapChange (":colormap-change"),
  682.           XEnterWindow (":enter-window"),
  683.           XExposure (":exposure"),
  684.           XFocusChange (":focus-change"),
  685.           XKeyPress (":key-press"),
  686.           XKeyRelease (":key-release"),
  687.           XKeymapState (":keymap-state"),
  688.           XLeaveWindow (":leave-window"),
  689.           XOwnerGrabButton (":owner-grab-button"),
  690.           XPointerMotion (":pointer-motion"),
  691.           XPointerMotionHint (":pointer-motion-hint"),
  692.           XPropertyChange (":property-change"),
  693.           XResizeRedirect (":resize-redirect"),
  694.           XStructureNotify (":structure-notify"),
  695.           XSubstructureRedirect (":substructure-notify"),
  696.           XVisibilityChange (":visibility-change")),
  697.    XStateMask (XStateMask ("x-make-state-mask", "x-state-mask-key-list")),
  698.    XStateMaskKey (XShift (":shift"),
  699.                   XLock (":lock"),
  700.           XControl (":control"),
  701.           XMod1 (":mod-1"),
  702.           XMod2 (":mod-2"),
  703.           XMod3 (":mod-3"),
  704.           XMod4 (":mod-4"),
  705.           XMod5 (":mod-5"),
  706.           XButton1 (":button-1"),
  707.           XButton2 (":button-2"),
  708.           XButton3 (":button-3"),
  709.           XButton4 (":button-4"),
  710.           XButton5 (":button-5")),
  711.   XWinAttribute
  712.     (XWinBackground ("is-background","mk-background","keyword-val"),
  713.      XWinEventMask ("is-event-mask","mk-event-mask","keyword-val"),
  714.      XWinDepth ("is-depth","mk-depth","keyword-val"),
  715.      XWinBorderWidth ("is-border-width","mk-border-width","keyword-val"),
  716.      XWinClass ("is-class","mk-class","keyword-val"),
  717.      XWinVisual ("is-visual","mk-visual","keyword-val"),
  718.      XWinBorder ("is-border","mk-border","keyword-val"),
  719.      XWinBackingStore ("is-backing-store","mk-backing-store","keyword-val"),
  720.      XWinBackingPlanes ("is-backing-planes","mk-backing-planes","keyword-val"),
  721.      XWinBackingPixel ("is-backing-pixel","mk-backing-pixel","keyword-val"),
  722.      XWinSaveUnder ("is-save-under","mk-save-under","keyword-val"),
  723.      XWinDoNotPropagateMask ("is-do-not-propagate-mask",
  724.                        "mk-do-not-propagate-mask","keyword-val"),
  725.      XWinOverrideRedirect("is-override-redirect",
  726.                           "mk-override-redirect","keyword-val"),
  727.      XWinColormap ("is-colormap","mk-colormap","keyword-val"),
  728.      XWinCursor ("is-cursor","mk-cursor","keyword-val")),
  729.    XGCAttribute(
  730.      XGCArcMode ("is-arc-mode","mk-arc-mode","keyword-val"),
  731.      XGCBackground ("is-background","mk-background","keyword-val"),
  732.      XGCCapStyle ("is-cap-style","mk-cap-style","keyword-val"),
  733.      XGCClipMask ("is-clip-mask","mk-clip-mask","keyword-val"),
  734.      XGCClipOrigin ("is-clip-origin","mk-clip-origin","keyword-val"),
  735.      XGCDashOffset ("is-dash-offset","mk-dash-offset","keyword-val"),
  736.      XGCDashes ("is-dashes","mk-dashes","keyword-val"),
  737.      XGCExposures ("is-exposures","mk-exposures","keyword-val"),
  738.      XGCFillRule ("is-fill-rule","mk-fill-rule","keyword-val"),
  739.      XGCFillStyle ("is-fill-style","mk-fill-style","keyword-val"),
  740.      XGCFont ("is-font","mk-font","keyword-val"),
  741.      XGCForeground ("is-foreground","mk-foreground","keyword-val"),
  742.      XGCFunction ("is-function","mk-function","keyword-val"),
  743.      XGCJoinStyle ("is-join-style","mk-join-style","keyword-val"),
  744.      XGCLineStyle ("is-line-style","mk-line-style","keyword-val"),
  745.      XGCLineWidth ("is-line-width","mk-line-width","keyword-val"),
  746.      XGCPlaneMask ("is-plane-mask","mk-plane-mask","keyword-val"),
  747.      XGCStipple ("is-stipple","mk-stipple","keyword-val"),
  748.      XGCSubwindowMode ("is-subwindow-mode","mk-subwindow-mode","keyword-val"),
  749.      XGCTile ("is-tile","mk-tile","keyword-val"),
  750.      XGCTileOrigin ("is-tile-origin","mk-tile-origin","keyword-val")),
  751.    XImAttribute (
  752.      XImBitLsbFirstP ("is-bit-lsb-first-p","mk-bit-lsb-first-p","keyword-val"),
  753.      XImBitsPerPixel ("is-bits-per-pixel","mk-bits-per-pixel","keyword-val"),
  754.      XImBlueMask ("is-blue-mask","mk-blue-mask","keyword-val"),
  755.      XImByteLsbFirstP ("is-byte-lsb-first-p","mk-byte-lsb-first-p","keyword-val"),
  756.      XImBytesPerLine ("is-bytes-per-line","mk-bytes-per-line","keyword-val"),
  757.      XImData ("is-data","mk-data","keyword-val"),
  758.      XImDepth ("is-depth","mk-depth","keyword-val"),
  759.      XImFormat ("is-format","mk-format","keyword-val"),
  760.      XImGreenMask ("is-green-mask","mk-green-mask","keyword-val"),
  761.      XImSize ("is-size","mk-size","keyword-val"),
  762.      XImName ("is-name","mk-name","keyword-val"),
  763.      XImRedMask ("is-red-mask","mk-red-mask","keyword-val"),
  764.      XImHotSpot ("is-hot-spot","mk-hot-spot","keyword-val")),
  765.    XGrabAttribute (
  766.      XGrabOwnerP ("is-owner-p", "mk-owner-p", "keyword-val"),
  767.      XGrabSyncPointerP ("is-sync-pointer-p", "mk-sync-pointer-p", "keyword-val"),
  768.      XGrabSyncKeyboardP ("is-sync-keyboard-p", "mk-sync-keyboard-p", "keyword-val"),
  769.      XGrabConfineTo ("is-confine-to", "mk-confine-to", "keyword-val"),
  770.      XGrabCursor ("is-cursor", "mk-cursor", "keyword-val")),
  771.    XArcMode (XChord (":chord"),
  772.              XPieSlice (":pie-slice")),
  773.    XCapStyle (XButt (":butt"),
  774.               XNotLast (":not-last"),
  775.           XProjecting (":projecting"),
  776.           XRound (":round")),
  777.    XClipMask (XClipMaskPixmap ("xlib:pixmap-p","identity","identity"),
  778.           XClipMaskRects ("not-pixmap-and-list-p","mk-clip-mask-rects",
  779.                           "sel-clip-mask-rects"),
  780.           XClipMaskNone ("null?", "()")),
  781.    XFillRule (XFillEvenOdd (":even-odd"),
  782.               XFillWinding (":winding")),
  783.    XFillStyle (XFillOpaqueStippled (":opaque-stippled"),
  784.                XFillSolid (":solid"),
  785.            XFillStippled (":stippled"),
  786.            XFillTiled (":tiled")),
  787.    XFunction (XBoole1 ("xlib::boole-1"),
  788.               XBoole2 ("xlib::boole-2"),
  789.           XBooleAndC1 ("xlib::boole-andc1"),
  790.           XBooleAndC2 ("xlib::boole-andc2"),
  791.           XBooleAnd ("xlib::boole-and"),
  792.           XBooleC1 ("xlib::boole-c1"),
  793.           XBooleC2 ("xlib::boole-c2"),
  794.           XBooleClr ("xlib::boole-clr"),
  795.           XBooleEqv ("xlib::boole-eqv"),
  796.           XBooleIor ("xlib::boole-ior"),
  797.           XBooleNand ("xlib::boole-nand"),
  798.           XBooleNor ("xlib::boole-nor"),
  799.           XBooleOrc1 ("xlib::boole-orc1"),
  800.           XBooleOrc2 ("xlib::boole-orc2"),
  801.           XBooleSet ("xlib::boole-set"),
  802.           XBooleXor ("xlib::boole-xor")),
  803.    XJoinStyle (XJoinBevel (":bevel"),
  804.                XJoinMiter (":miter"),
  805.            XJoinRound (":round")),
  806.    XLineStyle (XLineSolid (":solid"),
  807.                XLineDoubleDash (":double-dash"),
  808.            XLineOnOffDash (":on-off-dash")),
  809.    XSubwindowMode (XClipByChildren (":clip-by-children"),
  810.                   XIncludeInferiors (":include-inferiors")),
  811.    XPoint(XPoint("mk-xpoint", "xpoint-x", "xpoint-y")),
  812.    XSize (XSize ("mk-xsize", "xsize-w", "xsize-h")),
  813.    XRect (XRect ("mk-xrect", "xrect-x", "xrect-y", "xrect-w", "xrect-h")),
  814.    XArc    (XArc ("mk-xarc", "xarc-x", "xarc-y", "xarc-w", "xarc-h",
  815.            "xarc-a1", "xarc-a2")),
  816.    XBitmapFormat 
  817.     (XBitmapFormat ("bitmap-format-p", "mk-bitmap-format",
  818.             "xlib:bitmap-format-unit",
  819.             "xlib:bitmap-format-pad",
  820.             "xlib:bitmap-format-lsb-first-p")),
  821.    XByteOrder (XLsbFirst (":lsbfirst"),
  822.                XMsbFirst (":msbfirst")),
  823.    XPixmapFormat (XPixmapFormat ("pixmap-format-p", "mk-pixmap-format", 
  824.                      "xlib:pixmap-format-depth",
  825.                      "xlib:pixmap-format-bits-per-pixel",
  826.                      "xlib:pixmap-format-scanline-pad")),
  827.    XVisualInfo 
  828.     (XVisualInfo (    "visual-info-p", "mk-xvisual-info", 
  829.                   "xlib:visual-info-id", 
  830.                   "xlib:visual-info-class",
  831.                   "xlib:visual-info-red-mask",
  832.             "xlib:visual-info-green-mask",
  833.             "xlib:visual-info-blue-mask",
  834.              "xlib:visual-info-bits-per-rgb", 
  835.             "xlib:visual-info-colormap-entries")),
  836.    XVisualClass (XDirectColor (":direct-color"),
  837.              XGrayScale (":gray-scale"),
  838.          XPseudoColor (":pseudo-color"),
  839.          XStaticColor (":static-color"),
  840.          XStaticGray  (":static-gray"),
  841.          XTrueColor   (":true-color")),
  842.    XFillContent (XFillPixel  ("is-fill-pixel", "identity","identity"),
  843.                 XFillPixmap ("xlib:pixmap-p", "identity","identity"),
  844.          XFillNone (":none"),
  845.          XFillParentRelative (":parent-relative"),
  846.          XFillCopy (":copy")),
  847.    XBackingStore (XAlwaysBackStore (":always"),
  848.                   XNeverBackStore (":never"),
  849.                   XBackStoreWhenMapped (":when-mapped"),
  850.           XBackStoreNotUseful (":not-useful")),
  851.    XGravity (XForget (":forget"),
  852.              XStatic (":static"),
  853.          XCenter (":center"),
  854.          XEast (":east"),
  855.          XNorth (":north"),
  856.          XNorthEast (":north-east"),
  857.          XNorthWest (":north-west"),
  858.          XSouth (":south"),
  859.          XSouthEast (":south-east"),
  860.          XSouthWest (":south-west"),
  861.          XWest ("west")),
  862.    XWindowClass (XInputOutput (":input-output"),
  863.                  XInputOnly (":input-only")),
  864.    XMapState (XUnmapped (":unmapped"),
  865.               XUnviewable (":unviewable"),
  866.           XViewable (":viewable")),
  867.    XImageData (XBitmapData ("bitmap-list-p", "haskell-list->list/identity", "list->haskell-list/identity"),
  868.            XPixarrayData ("pixarray-p", "identity", "identity"),
  869.            XByteVecData ("bytevec-p", "identity", "identity")),
  870.    XImageFormat (XXyPixmapImage (":xy-pixmap"),
  871.                  XZPixmapImage (":z-pixmap"),
  872.          XBitmapImage (":bitmap")),
  873.    XImageType (XImageX ("'xlib:image-x"),
  874.                XImageXy ("'xlib:image-xy"),
  875.            XImageZ ("'xlib:image-z")),
  876.    XDrawDirection (XLeftToRight (":left-to-right"),
  877.                XRightToLeft (":right-to-left")),
  878.    XColor (XColor ("xlib:color-p", "mk-color", 
  879.                    "xlib:color-red", "xlib:color-green", "xlib:color-blue")),
  880.    XInputFocus (XFocusWindow ("xlib:window-p", "identity", "identity"),
  881.                 XFocusNone (":none"),
  882.         XFocusPointerRoot (":pointer-root"),
  883.         XFocusParent (":parent")),
  884.    XGrabStatus (XAlreadyGrabbed (":already-grabbed"),
  885.                 XFrozen (":frozen"),
  886.                 XInvalidTime (":invalid-time"),
  887.         XNotViewable (":not-viewable"),
  888.         XSuccess (":success")),
  889.    XCloseDownMode (XDestroy (":destroy"),
  890.                XRetainPermanent (":retain-permanent"),
  891.            XRetainTemporary (":retain-temporary")),
  892.    XScreenSaver (XScreenSaver ("list", "car", "cadr", "caddr", "cadddr")))
  893.  
  894. #-}
  895.  
  896.